<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
    <title>CLUSTER FAILOVER命令文档翻译 - 天地维杰网</title>
    <meta name="keywords" content="系统架构,shutdown,不与天斗,Domino,博客,程序员,架构师,笔记,技术,分享,java,Redis">
    
    <meta property="og:title" content="CLUSTER FAILOVER命令文档翻译">
    <meta property="og:site_name" content="天地维杰网">
    <meta property="og:image" content="/img/author.jpg"> 
    <meta name="title" content="CLUSTER FAILOVER命令文档翻译 - 天地维杰网" />
    <meta name="description" content="`CLUSTER FAILOVER [FORCE | TAKEOVER]`该命令仅能被发送到集群的slave从节点，强制该slave从节点开启手动故障转移。 手动故障转移是一种特殊的故障转移，通常在没有实际故障的情况下执行，我们希望将当前主节点与其中一个slave从节点（我们发送该命令的节点）交换（安全地，而不会有数据丢失的窗口）。" />
     
    <link rel="shortcut icon" href="http://www.shutdown.cn/img/favicon.ico" />
    <link rel="apple-touch-icon" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link href="http://www.shutdown.cn/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/main.css" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/syntax.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
     fancybox: true, 
    motion: true
  };
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7826003325059020" crossorigin="anonymous"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left page-home  ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"> <div class="site-meta  custom-logo ">

  <div class="custom-logo-site-title">
    <a href="http://www.shutdown.cn"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">天地维杰网</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">人如秋鸿来有信，事若春梦了无痕</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
    <ul id="menu" class="menu">
      
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/redis/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-full"></i> <br />Redis
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/java/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-coffee"></i> <br />java
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/linux/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-linux"></i> <br />linux
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/daily/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bug"></i> <br />日常问题
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/spring/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-child"></i> <br />Spring和Springboot
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/mac/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-fire"></i> <br />Mac相关
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/middleware/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-gavel"></i> <br />中间件
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jiagou/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />架构
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/python/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-ship"></i> <br />python
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/front/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bolt"></i> <br />前端
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jvm/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-balance-scale"></i> <br />jvm
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/c/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-empty"></i> <br />c语言
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/web3/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-web3"></i> <br />web3
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/post/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/about/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于
          </a>
        </li>
      
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索</a>
      </li>
    </ul>
    <div class="site-search">
      <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>

    </div>
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
<section id="posts" class="posts-expand">
  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">
        <a class="post-title-link" href="http://www.shutdown.cn/post/redis-cluster-failover-force-or-takeover/" itemprop="url">
        CLUSTER FAILOVER命令文档翻译
        </a>
      </h1>
      <div class="post-meta">
      <span class="post-time">
<span class="post-meta-item-icon">
    <i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">时间：</span>
<time itemprop="dateCreated" datetime="2016-03-22T13:04:35+08:00" content="2022-04-14">
    2022-04-14
</time>
</span> 
      

  <span class="post-category" >
  &nbsp; | &nbsp;
  <span class="post-meta-item-icon">
    <i class="fa fa-folder-o"></i>
  </span>
  <span class="post-meta-item-text">分类：</span>
  
    <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
      <a href="http://www.shutdown.cn/categories/redis" itemprop="url" rel="index">
        <span itemprop="name">redis</span>
      </a>
      &nbsp; 
    </span>
  
</span>


      
 <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">翻译</span>
</span>

       <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读：</span>
<span class="leancloud-visitors-count">2805 字 ~6分钟</span>
</span>
      </div>
    </header>
    <div class="post-body" itemprop="articleBody">
    
    <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback"> 翻译文章，原文地址：https://redis.io/commands/cluster-failover/</code></pre></div>
    

    

<p><strong>Available since:</strong> 3.0.0</p>

<p><strong>Time complexity:</strong> O(1)</p>

<p><strong>ACL categories:</strong> <code>@admin</code> <code>@slow</code> <code>@dangerous</code></p>

<p>This command, that can only be sent to a Redis Cluster replica node, forces the replica to start a manual failover of its master instance.</p>

<blockquote>
<p>该命令仅能被发送到集群的slave从节点，强制该slave从节点开启手动故障转移。</p>
</blockquote>

<p>A manual failover is a special kind of failover that is usually executed when there are no actual failures, but we wish to swap the current master with one of its replicas (which is the node we send the command to), in a safe way, without any window for data loss. It works in the following way:</p>

<blockquote>
<p>手动故障转移是一种特殊的故障转移，通常在没有实际故障的情况下执行，我们希望将当前主节点与其中一个slave从节点（我们发送该命令的节点）交换（安全地，而不会有数据丢失的窗口）。它的工作步骤如下：</p>
</blockquote>

<ol>
<li>The replica tells the master to stop processing queries from clients.</li>
<li>The master replies to the replica with the current <em>replication offset</em>.</li>
<li>The replica waits for the replication offset to match on its side, to make sure it processed all the data from the master before it continues.</li>
<li>The replica starts a failover, obtains a new configuration epoch from the majority of the masters, and broadcasts the new configuration.</li>
<li>The old master receives the configuration update: unblocks its clients and starts replying with redirection messages so that they&rsquo;ll continue the chat with the new master.</li>
</ol>

<blockquote>
<ol>
<li>当前slave从节点通知主节点停止处理客户端的请求。</li>
<li>主节点回复slave从节点当前的 *同步偏移量*。</li>
<li>slave从节点等待同步偏移量在slave从节点的侧匹配，以确保它已经处理了所有主节点的数据，然后继续。</li>
<li>slave从节点开始故障转移，从主节点的大多数主节点获取新的配置纪元值epoch，并广播新的配置。</li>
<li>旧的主节点接收配置更新：解除对客户端访问的阻止，并开始回复重定向消息，以便它们继续与新的主节点通信。</li>
</ol>
</blockquote>

<p>This way clients are moved away from the old master to the new master atomically and only when the replica that is turning into the new master has processed all of the replication stream from the old master.</p>

<blockquote>
<p>只有当正在切换为新的主节点当前slave从节点处理了所有旧的主节点的同步(复制)流以后，客户端的访问才会自动从旧的主节点切换到新的主节点。</p>
</blockquote>

<h2 id="force-option-manual-failover-when-the-master-is-down">FORCE option: manual failover when the master is down</h2>

<blockquote>
<p>FORCE 选项：当主节点停止时手动故障转移</p>
</blockquote>

<p>When the master is down, the replica will automatically start a manual failover.</p>

<blockquote>
<p>当主节点停止时，slave从节点会自动开启手动故障转移。</p>
</blockquote>

<p>The command behavior can be modified by two options: <strong>FORCE</strong> and <strong>TAKEOVER</strong>.</p>

<blockquote>
<p>该命令有两个选项：<strong>FORCE</strong> 和 <strong>TAKEOVER</strong>。</p>
</blockquote>

<p>If the <strong>FORCE</strong> option is given, the replica does not perform any handshake with the master, that may be not reachable, but instead just starts a failover ASAP starting from point 4. This is useful when we want to start a manual failover while the master is no longer reachable.</p>

<blockquote>
<p>如果选择<strong>FORCE</strong>选项，slave从节点不会与master主节点进行协商（master节点可能不可达），而是直接尽快从上文的故障转移步骤中的第4步开始做故障转移。当主节点不可达时，<strong>FORCE</strong>选项对于我们做手动故障转移非常有用。</p>
</blockquote>

<p>However using <strong>FORCE</strong> we still need the majority of masters to be available in order to authorize the failover and generate a new configuration epoch for the replica that is going to become master.</p>

<blockquote>
<p>但是使用<strong>FORCE</strong>选项，我们仍然需要大多数主节点可用，以便授权故障转移并为将成为新的主节点的slave从节点生成新的配置纪元值epoch（纪元）。</p>
</blockquote>

<h2 id="takeover-option-manual-failover-without-cluster-consensus">TAKEOVER option: manual failover without cluster consensus</h2>

<blockquote>
<p><em>TAKEOVER</em> 选项: 忽略群集一致验证的的人工故障切换</p>
</blockquote>

<p>There are situations where this is not enough, and we want a replica to failover without any agreement with the rest of the cluster. A real world use case for this is to mass promote replicas in a different data center to masters in order to perform a data center switch, while all the masters are down or partitioned away.</p>

<blockquote>
<p>有些场景下，集群中的master节点不足，我们需要不经其他的集群节点协商一致就进行故障迁移。实际用途举例：集群中主节点和从节点在不同的数据中心，当所有主节点down掉或被网络分区隔离，需要用该参数将slave节点 批量切换为master节点。</p>
</blockquote>

<p>The <strong>TAKEOVER</strong> option implies everything <strong>FORCE</strong> implies, but also does not uses any cluster authorization in order to failover. A replica receiving <code>CLUSTER FAILOVER TAKEOVER</code> will instead:</p>

<blockquote>
<p><strong>TACKOVER</strong>选项实现了<strong>FORCE</strong>选项的所有实现，但是无需集群一致性验证来进行故障转移。
当slave从节点点接收到<code>CLUSTER FAILOVER TAKEOVER</code>命令时，它会：</p>
</blockquote>

<ol>
<li>Generate a new <code>configEpoch</code> unilaterally, just taking the current greatest epoch available and incrementing it if its local configuration epoch is not already the greatest.</li>
<li>Assign itself all the hash slots of its master, and propagate the new configuration to every node which is reachable ASAP, and eventually to every other node.</li>
</ol>

<blockquote>
<ol>
<li>生成一个新的配置纪元值epoch，不经过集群一致性验证，直接将当前集群的最大的配置纪元值epoch设置为本地配置的纪元值epoch，并且如果本地配置纪元值epoch仍不是集群最大的配置纪元值epoch，则将其加1。</li>
<li>将它对应的master节点的所有哈希槽位都分配给自己，并将新的配置纪元值epoch尽快传播到所有可达的节点，最终传播给所有的非当前节点（即所有的可达的节点和后续恢复的故障节点）。</li>
</ol>
</blockquote>

<p>Note that <strong>TAKEOVER violates the last-failover-wins principle</strong> of Redis Cluster, since the configuration epoch generated by the replica violates the normal generation of configuration epochs in several ways:</p>

<blockquote>
<p>需要注意的是注意：<strong>TAKEOVER选项违反Redis群集最新-故障转移-有效 原则</strong>，因为slave节点产生的配置epoch会通过以下几种方式让正常产生的的配置epoch无效：</p>
</blockquote>

<ol>
<li>There is no guarantee that it is actually the higher configuration epoch, since, for example, we can use the <strong>TAKEOVER</strong> option within a minority, nor any message exchange is performed to generate the new configuration epoch.</li>
<li>If we generate a configuration epoch which happens to collide with another instance, eventually our configuration epoch, or the one of another instance with our same epoch, will be moved away using the <strong>configuration epoch collision resolution algorithm</strong>.</li>
</ol>

<blockquote>
<ol>
<li>例如，我们可以在一个少数节点中使用<strong>TAKEOVER</strong>选项，而不会执行任何消息交换来生成新的配置纪元值epoch。这样就不能保证正常产生的配置纪元是最大的配置纪元了。</li>
<li>如果我们新生成的配置纪元和其他实例的配置纪元相同，最终两者会被通过使用<strong>配置纪元冲突解决算法</strong>舍弃掉一个。（当两个节点的配置纪元值相等时，nodeId更大的一方会递增全局配置纪元[currentEpoch]并赋值给当前节点来区分冲突）</li>
</ol>
</blockquote>

<p>Because of this the <strong>TAKEOVER</strong> option should be used with care.</p>

<blockquote>
<p>因此，<strong>TAKEOVER</strong>选项应该谨慎使用。</p>
</blockquote>

<h2 id="implementation-details-and-notes">Implementation details and notes</h2>

<blockquote>
<p>实现详细信息和注意事项</p>
</blockquote>

<ul>
<li><code>CLUSTER FAILOVER</code>, unless the <strong>TAKEOVER</strong> option is specified, does not execute a failover synchronously. It only <em>schedules</em> a manual failover, bypassing the failure detection stage.
&gt;   如果没有指定<strong>TAKEOVER</strong>选项，则<code>CLUSTER FAILOVER</code>命令不会同步执行故障转移，它只跳过了故障检测阶段，添加了一个手动故障转移的任务。</li>
<li>An <code>OK</code> reply is no guarantee that the failover will succeed.
&gt;   即使命令执行后返回了<code>OK</code>，也不能保证故障转移成功执行。</li>
<li>A replica can only be promoted to a master if it is known as a replica by a majority of the masters in the cluster. If the replica is a new node that has just been added to the cluster (for example after upgrading it), it may not yet be known to all the masters in the cluster. To check that the masters are aware of a new replica, you can send <a href="https://redis.io/commands/cluster-nodes"><code>CLUSTER NODES</code></a> or <a href="https://redis.io/commands/cluster-replicas"><code>CLUSTER REPLICAS</code></a> to each of the master nodes and check that it appears as a replica, before sending <code>CLUSTER FAILOVER</code> to the replica.
&gt; 只有集群中大部分的master节点感知到了一个新的slave节点，才能将其转换为master节点。新加入到集群的slave节点可能不会被所有的master节点感知到( for example after upgrading it（比如说刚升级完？升什么级？）。此时可以通过抽每个master节点发送 <code>CLUSTER NODES</code>命令或者<code>CLUSTER REPLICAS</code>命令来检查是否被所有的master节点感知到了。然后再向slave从节点发送 <code>CLUSTER FAILOVER</code>命令。</li>

<li><p>To check that the failover has actually happened you can use <a href="https://redis.io/commands/role"><code>ROLE</code></a>, <code>INFO REPLICATION</code> (which indicates &ldquo;role:master&rdquo; after successful failover), or <a href="https://redis.io/commands/cluster-nodes"><code>CLUSTER NODES</code></a> to verify that the state of the cluster has changed sometime after the command was sent.</p>

<blockquote>
<p>检查故障转移是否真的发生了，可以使用<a href="https://redis.io/commands/role"><code>ROLE</code></a>命令，<code>INFO REPLICATION</code>命令（在故障转移成功后，它会显示“role:master”）或者<a href="https://redis.io/commands/cluster-nodes"><code>CLUSTER NODES</code></a>命令来检查集群的状态是否发生了变化。</p>
</blockquote></li>

<li><p>To check if the failover has failed, check the replica&rsquo;s log for &ldquo;Manual failover timed out&rdquo;, which is logged if the replica has given up after a few seconds.</p>

<blockquote>
<p>检查故障转移是否失败，可以通过检查slave从节点的日志中的“Manual failover timed out”输出，slave从节点如果放弃操作，会在几秒钟后向日志输入这个内容。</p>
</blockquote></li>
</ul>

<h2 id="return">Return</h2>

<blockquote>
<p>返回值</p>
</blockquote>

<p><a href="https://redis.io/docs/reference/protocol-spec#resp-simple-strings">Simple string reply</a>: <code>OK</code> if the command was accepted and a manual failover is going to be attempted. An error if the operation cannot be executed, for example if we are talking with a node which is already a master.</p>

<blockquote>
<p>返回字符串：如果命令被接受，会返回<code>OK</code>并尝试执行一个手动故障转移。如果操作无法执行，比如执行命令的节点已经是一个master节点，则返回一个error错误。</p>
</blockquote>

    </div>
    <footer class="post-footer">
     
 
<div class="post-tags">     
     
    <a href="http://www.shutdown.cn/tags/redis" rel="tag" title="redis">#redis#</a>
    
    <a href="http://www.shutdown.cn/tags/cluster" rel="tag" title="cluster">#cluster#</a>
    
    <a href="http://www.shutdown.cn/tags/failover" rel="tag" title="failover">#failover#</a>
    
    <a href="http://www.shutdown.cn/tags/force" rel="tag" title="force">#force#</a>
    
    <a href="http://www.shutdown.cn/tags/takeover" rel="tag" title="takeover">#takeover#</a>
    
    <a href="http://www.shutdown.cn/tags/%e7%bf%bb%e8%af%91" rel="tag" title="翻译">#翻译#</a>
    
</div>



     <div class="post-nav">
    <div class="post-nav-next post-nav-item">
    
        <a href="http://www.shutdown.cn/post/mac-external-2k-monitor-problem/" rel="next" title="Mac外接2k显示器遇到的问题">
        <i class="fa fa-chevron-left"></i> Mac外接2k显示器遇到的问题
        </a>
    
    </div>

    <div class="post-nav-prev post-nav-item">
    
        <a href="http://www.shutdown.cn/post/mac-vscode-flower-screen-sloved/" rel="prev" title="Mac vscode花屏问题解决">
        Mac vscode花屏问题解决 <i class="fa fa-chevron-right"></i>
        </a>
    
    </div>
</div>
      
     
     
     






    </footer>
  </article>
</section>

          </div>
        </div>
        <div class="sidebar-toggle">
  <div class="sidebar-toggle-line-wrap">
    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
  </div>
</div>
<aside id="sidebar" class="sidebar">
  <div class="sidebar-inner">

  <ul class="sidebar-nav motion-element">
    <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
      文章目录
    </li>
    <li class="sidebar-nav-overview" data-target="site-overview">
      站点概览
    </li>
  </ul>

    <section class="site-overview sidebar-panel ">
      <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
        src="http://www.shutdown.cn/img/author.jpg"
        alt="不与天斗Domino" />
    <p class="site-author-name" itemprop="name">不与天斗Domino</p>
    <p class="site-description motion-element" itemprop="description"> 
        Programmer &amp; Architect</p>
</div>
      <nav class="site-state motion-element">
    <div class="site-state-item site-state-posts">
      <a href="http://www.shutdown.cn/post/">
        <span class="site-state-item-count">183</span>
        <span class="site-state-item-name">日志</span>
      </a>
    </div>
    <div class="site-state-item site-state-categories">    
        <a href="http://www.shutdown.cn/categories/">      
         
        <span class="site-state-item-count">15</span>
        
        <span class="site-state-item-name">分类</span>
        
        </a>
    </div>

    <div class="site-state-item site-state-tags">
        <a href="http://www.shutdown.cn/tags/">
         
        <span class="site-state-item-count">224</span>
        
        <span class="site-state-item-name">标签</span>
        </a>
    </div>
</nav>
      
      

      

      <div class="links-of-blogroll motion-element inline">
<script type="text/javascript" src="//rf.revolvermaps.com/0/0/8.js?i=&amp;m=0&amp;s=220&amp;c=ff0000&amp;cr1=ffffff&amp;f=arial&amp;l=33&amp;bv=35" async="async"></script>
</div>

    </section>
    
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
    <div class="post-toc">
        <div class="post-toc-content"><nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#force-option-manual-failover-when-the-master-is-down">FORCE option: manual failover when the master is down</a></li>
<li><a href="#takeover-option-manual-failover-without-cluster-consensus">TAKEOVER option: manual failover without cluster consensus</a></li>
<li><a href="#implementation-details-and-notes">Implementation details and notes</a></li>
<li><a href="#return">Return</a></li>
</ul></li>
</ul>
</nav></div>
    </div>
</section>

  </div>
</aside>

      </div>
    </main>
   
    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  <span itemprop="copyrightYear">  &copy; 
  2013 - 2023</span>
  <span class="with-love"><i class="fa fa-heart"></i></span>
  <span class="author" itemprop="copyrightHolder">天地维杰网</span>
  <span class="icp" itemprop="copyrightHolder"><a href="https://beian.miit.gov.cn/" target="_blank">京ICP备13019191号-1</a></span>
</div>
<div class="powered-by">
  Powered by - <a class="theme-link" href="http://gohugo.io" target="_blank" title="hugo" >Hugo v0.63.2</a>
</div>
<div class="theme-info">
  Theme by - <a class="theme-link" href="https://github.com/xtfly/hugo-theme-next" target="_blank"> NexT
  </a>
</div>


      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
      <span id="scrollpercent"><span>0</span>%</span>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/fastclick/lib/fastclick.min.js?v=1.0.6"></script> 
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="http://www.shutdown.cn/js/vendor/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>

<script src="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/utils.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/motion.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/affix.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/schemes/pisces.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/scrollspy.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/post-details.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/toc.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/bootstrap.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'] ],
      processEscapes: true
    },
    "HTML-CSS": { fonts: ["TeX"] }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML' async></script>
</body>
</html>